#include <iostream>

using namespace std;

class Shape {
protected:
	double _data1, _data2;
public:
	Shape(double d1, double d2)
		:_data1(d1), _data2(d2) { }

	virtual void draw() = 0;
};

class Circle : public Shape {
public:
	Circle(double r)
		:Shape(r, r) { }
	void draw()
	{
		cout << "the area of this cicle is " << 3.14 * _data1 * _data1 << endl;
	}
};

class Rectangle : public Shape {
public:
	Rectangle(double lenth, double width)
		: Shape(lenth, width) { }
	void draw()
	{
		cout << "the area of this rectangle is " << _data1 * _data2 << endl;
	}
};

int main()
{
	Shape* pShape;
	Circle c(2);
	Rectangle r(3, 4);

	pShape = &c;
	pShape->draw();

	pShape = &r;
	pShape->draw();

	return 0;
}